﻿@model IEnumerable<Blogger.UI.Models.Blog>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_UILayout.cshtml";
}

<h2>
    Blogs For You...</h2>
<p>
    Go and @Html.ActionLink("Create New", "Create") Blogs for you. You can then select
    a blog and post as many as articles there.
</p>
<table>
    <tr>
        <th class="mota">
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th class="mota">
            @Html.DisplayNameFor(model => model.Title)
        </th>
       
        <th class="mota">
            @Html.DisplayNameFor(model => model.Category)
        </th>
        <th class="mota">
            Description of the Blog
        </th>
        <th class="mota">
            @Html.DisplayNameFor(model => model.User)
        </th>
         <th class="mota">
            Your Posts
        </th>
        <th class="mota">
            Manage Blogs
        </th>
    </tr>
    @if (!Model.Any())
    {
        <tr>
            <td  class="mota" colspan="7">
                You have yet to have any Blogs so far . @Html.ActionLink("Create New", "Create")
                Blogs
            </td>
        </tr>
    }
    @foreach (var item in Model)
    {
        <tr>
            <td class="mota">
                @Html.DisplayFor(modelItem => item.Name)
            </td>
            <td class="mota">
                @Html.DisplayFor(modelItem => item.Title)
            </td>
          
            <td class="mota">
                @Html.DisplayFor(modelItem => item.Category)
            </td>
            <td class="mota">
                @Html.DisplayFor(modelItem => item.Body)
            </td>
            <td class="mota">
                @Html.DisplayFor(modelItem => item.User)
            </td>
              <td class="mota">
                @Html.ActionLink("Explore Posts on Blogs", "Posting", "BlogUI", new { id = item.ID }, null)
            </td>
            <td class="mota">
                @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                @Html.ActionLink("Details", "Details", new { id = item.ID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ID })
            </td>
        </tr>
    }
</table>

